package com.xbongbong.parent.field;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.field.FilterConditionsPoJo;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.businessrule.pojo.BusinessRuleInfoPojo;

import java.util.List;

/**
 * @author 吴峰
 * @date 2021/07/07 14:22
 */
public interface FieldAnalyseService {
    /**
     * 返回固定值的字段类型
     *
     * @return
     */
    List<Integer> fieldType();
    /**
     * 字段解析成显示字段，用于消息标题，消息内容等展示
     * @param formId
     * @param businessType
     * @param saasMark
     * @param paasFormDataEntityExt
     * @param data
     * @param fieldAttrEntity
     * @return
     * @throws XbbException
     */
    Object analysisData(Long formId, Integer businessType, Integer saasMark, PaasFormDataEntityExt paasFormDataEntityExt, JSONObject data, FieldAttrEntity fieldAttrEntity) throws XbbException;

    /**
     * https://xbb.yuque.com/lfwuxq/vsf9sv/ap8doo
     * 处理前置过滤条件的固定值
     * 注：星级和音频暂时放在TEXT
     * @param thisField
     * @param businessRuleInfoPojo
     * @param filterCondition
     * @return
     * @throws XbbException
     */
    Object handlerPreConditionValue(FieldAttrEntity thisField, BusinessRuleInfoPojo businessRuleInfoPojo, FilterConditionsPoJo filterCondition) throws XbbException;

}
